//
//  LTView.m
//  LTView
//
//  Created by dllo on 15/12/16.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "LTView.h"
@implementation LTView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createLTView];
    }
    return self;
}
- (void)createLTView {
    //        左lable
    self.myLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
    self.myLable.backgroundColor = [UIColor clearColor];
//    _myLable.textAlignment = NSTextAlignmentCenter;
    _myLable.font = [UIFont systemFontOfSize:20];
    [self addSubview:_myLable];
    [_myLable release];
    
    //        右textfield
    self.myTextField = [[UITextField alloc]initWithFrame:CGRectMake(100, 0, 200, 50)];
    _myTextField.backgroundColor = [UIColor clearColor];
    //        自定义边框
    _myTextField.borderStyle = UITextBorderStyleRoundedRect;
    _myTextField.layer.borderWidth = 1;
    _myTextField.layer.borderColor = [UIColor lightGrayColor].CGColor;
    _myTextField.layer.cornerRadius = 10;

    //        删除按键
    _myTextField.clearButtonMode =
    UITextFieldViewModeAlways;
    _myTextField.clearsOnBeginEditing = YES;
    _myTextField.font = [UIFont systemFontOfSize:20];
    [self addSubview:_myTextField];
    [_myTextField release];
}
@end
